﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace KRF_KoreaSimulation
{
	class C_FILE
	{
		C_MSSG MS = new C_MSSG();
		C_CMMN CM = new C_CMMN();

		public static int fcnt = 0;

		public string writeResultMessage( )
		{
			try
			{
				using ( StreamReader  sr = new StreamReader( CM.RMSG ) )
				{
					string	str;
					while ( ( str = sr.ReadLine() ) != null )
					{
						string[] word = str.Split( '|' );
						C_CMMN.TIME.Add( fcnt, string.Format( "{0}", word[0] ) );
						C_CMMN.NDID.Add( fcnt, string.Format( "{0}", word[1] ) );
						C_CMMN.ACTS.Add( fcnt, string.Format( "{0}", word[2] ) );

						fcnt++;
					}
					sr.Close();
				}
			}
			catch ( Exception e )
			{
				// Let the user know what went wrong.
				return e.Message;
			}

			return MS.SUCC;
		}
	}
}
